import React from 'react'
import {connect} from 'react-redux'

import {Icon,Tabs} from 'antd-mobile'
import './header.css'
import {getIndex} from '../../redux/home'



@connect(
    state => state.homeTypes,
    {
        getIndex
    }
)
class Header extends React.Component {
    constructor(props) {
        super(props)
    }
    handleClick(title,index) {
        this.props.getIndex(index)
    }
    render() {
        return (
            <div className="flex_box">
                <div className="left flex_item">
                    <img src={require('../../images/logo.png')} alt=""/>
                    <span className="dingwei" >成都<Icon type="down" className="icon" size="xs" /></span>
                </div>
                <div className="right flex_item">
                    <Tabs
                        onTabClick={this.handleClick.bind(this)}
                        tabs={[{title:'正在热映'},{title:'即将上映'}]}
                    />
                    <Icon type="search" size="xs" className="search" />
                </div>
            </div>
        )
    }
}

export default Header